Keep typing indicators alive across chat re-entry - #261
Open
FrankBStack wants to merge 1 commit into
Open
Conversation
Typing state was stored on the ConversationViewController, so leaving a chat and coming back dropped the indicator even though the other side was still typing, and the expiry future kept a reference to the dead controller. Move the per-chat typing state into ChatManager, use a plain Timer for the one-minute expiry, and clear it all on data reset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Typing indicator state lived on the
ConversationViewController, so backing out of a chat and reopening it lost the indicator even though the other person was still typing. The expiry was also aFuture.delayed(...).asStream()subscription that held onto the old controller after it was disposed.Changes:
handles+ expiry data) now lives inChatManager, keyed by chat guid, so it outlives any one view controller.Timer; a fresh typing packet restarts it, a stop packet or an incoming message cancels it.ConversationViewController.showTypingIndicatorFor/typingIndicatorDataare now getters over the shared state, so the existing UI code is unchanged.